Vehicle compass compensation

ABSTRACT

A compass compensation system is provided for automatically and continuously calibrating an electronic compass for a vehicle, without requiring an initial manual calibration or preset of the vehicle magnetic signature. The system initially adjusts a two axis sensor of the compass in response to a sampling of at least one initial data point. The system further calibrates the compass by sampling data points that are substantially opposite to one another on a plot of a magnetic field and averaging an ordinate of the data points to determine a respective zero value for the Earth magnetic field. The system also identifies a change in magnetic signature and adjusts the sensor assembly.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims priority from provisional patent applicationSer. No. 60/128,262 filed on Apr. 8, 1999.

BACKGROUND OF THE INVENTION

This invention relates to a calibration system for a magnetic headingsensor, or compass, in a vehicle, and, more particularly to a continuousand fully automatic calibration system for the compass in the vehicle.The invention can be applied to a magneto-inductive sensor,magneto-resistive sensor, flux gate sensor and other known sensingtechnology.

Many vehicles today are equipped with magnetic compasses to determinethe direction in which the vehicle is heading and convey suchinformation to the passengers and/or driver of the particular vehicle.Generally, these magnetic compasses include a magneto-responsive sensor,such as a magnetic rotor sensor, a flux gate sensor, a magneto-resistivesensor, a magneto-inductive sensor, a magneto-capacitive sensor, or thelike. The magneto-responsive sensor detects the magnetic field presentin the vicinity of the vehicle and processes this signal in order todetermine a directional heading of the vehicle relative to the Earthmagnetic field. However, these magnetic compasses must be calibratedwithin the vehicle to account for any deviating magnetic field from thevehicle or other structures surrounding the vehicle, in order todetermine the true heading of the vehicle relative to the Earth magneticfield. Additionally, as the deviating field may change over time, due toeither a change in the magnetic signature of the vehicle or in themagnetic field surrounding the vehicle, an original calibration maylater become less accurate.

To date, there have been compasses proposed which include automaticmagnetic compass calibration within a vehicle after an initial manualadjustment or preset has been made to the compass system. Suchcalibration processes are performed as the vehicle is driven in order toaccount for changes in the deviating magnetic fields, therebymaintaining an accurate directional readout to the driver of thevehicle. However, many of these calibration systems require the vehicleto be oriented in specific directions relative to Earth magnetic field,such as orienting the vehicle in 180 degree opposite directions ordriving the vehicle in a complete 360 degree circle while data issampled by the system, in order to calibrate the system. Many othersystems alternatively require complicated mathematical functions todetermine the true Earth magnetic field based on several data pointscollected as the vehicle is driven in several directions. While thesesystems may provide an accurate calibration in many areas of the Earth,they are often based upon an assumption that a trace or plot of theEarth magnetic field is substantially circular in shape, as plotted on aCartesian coordinate system relative to the vehicle. In reality,however, irregularities may occur in the mounting of the compass and/orsensors in the vehicle such that the sensors may be tilted relative tothe magnetic field of the Earth. Furthermore, the variations ordeclinations present in the Earth magnetic field at any given locationare generally not perfectly symmetrical, as the declination variesirregularly over the Earth surface and further varies over a period oftime. These irregularities and variations may result in a substantiallynon-circular or oval-shaped trace of the magnetic field rather than thecircular field that many of the proposed calibration systems are basedon.

An additional concern with the systems proposed to date is that theinitial deviating magnetic field or magnetic signature of the vehiclemust be offset so that the magneto-responsive sensor's output will bewithin an operable range of the electronic processing system. As avehicle is manufactured, or shortly thereafter, the deviating field ofthe vehicle may be substantially offset or nullified by an initialpreset of the vehicle's magnetic signature, which brings an origin ofthe Earth magnetic field to within a predetermined range of a center ororigin of the compass coordinate system. Once the vehicle has itsmagnetic signature preset, the algorithmic or digital calibrationsystems may be implemented to refine the vehicle compass to within adesired range of accuracy.

Furthermore, the magnetic signature of a vehicle may changesignificantly over time, such as when a new sunroof motor is installedin the vehicle, a magnetic antenna is mounted to the vehicle or thelike. If the magnetic signature changes too much, the Earth magneticfield, as sensed by the sensors, may be shifted out of the operablerange of the analog-to-digital converter of the calibration system. Inorder to re-set the deviating magnetic field of the vehicle such thatthe sensed Earth field is back within the window of the calibrationsystems, the compass system may again need to be manually adjusted by amechanic or technician.

Therefore, there is a need in the art for a fully automatic andcontinuous calibration system for calibrating a magnetic compass locatedon a vehicle. The calibration system must be able to account for thedeviating magnetic field of the vehicle without requiring an initialpreset or demagnetization of the vehicle as the vehicle is assembled.Furthermore, the calibration system must continuously account for minorand major changes in the deviating magnetic field by digitally orphysically adjusting for such changes. These adjustments must alsoaccount for both circular and non-circular Earth magnetic fields.Furthermore, the calibration system must account for major changes inthe deviating magnetic field in order to avoid requiring manualadjustments throughout the life of the vehicle.

SUMMARY OF THE INVENTION

The present invention is intended to provide a fully automatic andcontinuous calibration system for vehicle compasses, which continuouslycalibrates the compass without requiring an initial preset of thevehicle magnetic signature or manual calibration of the compass.

According to an aspect of the present invention, a vehicular electroniccompass system comprises a magneto-responsive sensor for sensing amagnetic field and an electronic circuit responsive to the sensorassembly for determining either the magnitude or direction, or both, ofthe Earth magnetic field. The sensor detects at least one data point andthe electronic circuit adjusts the sensor according to an approximationof a center of the Earth magnetic field calculated from the at least onedata point and an estimated value of Earth magnetic field magnitude. Thesystem further includes a display coupled with the electronic circuitfor displaying a direction of the Earth magnetic field.

According to another aspect of the invention, a vehicular electroniccompass system includes a magneto-responsive sensor assembly for sensinga magnetic field and an electronic circuit responsive to the sensorassembly for determining either the magnitude or direction, or both, ofthe Earth magnetic field. The electronic circuit collects a plurality ofdata points relative to a coordinate system associated with the vehicle.Each of the data points has at least two components relative to thecoordinate system. The electronic circuit averages at least onecomponent of at least two of the data points to determine an estimatedvalue of the Earth magnetic field along at least one axis of thecoordinate system. In this manner, an estimated offset of the Earthmagnetic field is calculated and the electronic circuit adjusts adirectional heading output to account for the offset. An electronicdisplay is coupled with the circuit for displaying a direction of theEarth magnetic field.

According to yet another aspect of the invention, a vehicular electroniccompass system includes a magneto-responsive sensor assembly for sensinga magnetic field and an electronic circuit responsive to the sensorassembly for determining magnitude, direction, or both, of the Earthmagnetic field. The electronic circuit collects data points, determinesfrom the collected data points an offset value of the Earth magneticfield and adjusts a directional heading output of the sensor assembly toaccount for the offset value. The electronic circuit includes anextended range calibration function for identifying a change in magneticsignature from at least one of the sensor assembly and the offset value.The electronic circuit adjusts the sensor assembly in response to achange in magnetic signature. The system further includes an electronicdisplay coupled with the electronic circuit for displaying a directionof the Earth magnetic field.

According to a more detailed aspect of the invention, a vehicularelectronic compass system includes a magneto-responsive sensor assemblyfor sensing a magnetic field and a microcomputer system responsive tothe sensor assembly for determining magnitude, direction, or both, ofthe Earth magnetic field. The microcomputer system collects data points,determines from the collected data points an offset value of the Earthmagnetic field and adjusts a directional heading output of the sensorassembly to account for the offset. The microcomputer systemoccasionally calculates a new value of the offset. The microcomputersystem has a digital-to-analog converter converting digital values toanalog signals for adjusting the sensor assembly and ananalog-to-digital converter having a range of operation for convertingoutputs of the sensor assembly to digital values. The microcomputersystem adjusts the sensor assembly and calculates a new value of offsetin response to either i) an output of the sensor assembly exceeding therange of operation of the analog-to-digital converter, ii) an abnormalrelationship between collected data points and the value of the offset,or iii) a change in value of the offset which exceeds a predeterminedamount. The system further includes an electronic display coupled withthe microcomputer system for displaying a direction of the Earthmagnetic field.

A calibration method for calibrating a compass for use on a vehicleaccording to an aspect of the invention includes sampling at least onedata point of a magnetic field with a magnetic sensor, determiningcoordinates for the at least one data point relative to an origin of acoordinate system associated with the vehicle, estimating an origin ofthe Earth magnetic field from an estimated value of the Earth magneticfield magnitude and at least one data point and adjusting the sensor tooffset the estimated origin to the coordinate system associated with thevehicle.

According to another aspect of the invention, a calibration method forcalibrating a compass for use on a vehicle includes sampling at leastone pair of data points that are substantially oppositely positionedrelative to an axis of a coordinate system, averaging the substantiallyopposite values of the pair of data points to determine a deviation froma zero value of the coordinate system and adjusting an output of thesystem as a function of the deviation.

According to yet another aspect of the invention, a calibration methodfor calibrating a compass for use on a vehicle includes collecting datapoints with a sensor assembly, determining from the collected datapoints an offset value of the Earth magnetic field and adjusting adirectional heading output of the sensor assembly to account for theoffset. The method further includes identifying a change in magneticsignature from at least one of the sensor assembly and the offset valueand adjusting the sensor assembly in response to a change in magneticsignature.

These and other objects, advantages, purposes and features of thisinvention will become apparent upon review of the followingspecification in conjunction with the drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a vehicle compass system useful with thepresent invention;

FIG. 2 is a diagram illustrating a Cartesian coordinate systemassociated with the vehicle and a magnetic field, as read by the sensorof the present invention, displaced from the coordinate systemassociated with the vehicle by a deviating magnetic field;

FIG. 3 is a diagram depicting intercept points along the sensed magneticfield at which an embodiment of the present invention collects datasamples;

FIG. 4 is a diagram depicting the same intercept points as in FIG. 3,along an elliptical Earth magnetic field;

FIGS. 5 a and 5 b are a flow chart of a first calibration stage of acompass calibration technique according to the invention;

FIG. 6 is a flow chart of a second calibration stage of a compasscalibration technique according to the invention; FIG. 7 is a flow chartof a third calibration stage of a compass calibration techniqueaccording to the invention;

FIG. 8 is a flow chart of an A/D out-of-range function;

FIG. 9 is a flow chart of an axis point detect function;

FIG. 10 is a flow chart of a magnetic zero reference calibrationfunction;

FIG. 11 is the same flow chart as FIGS. 5 a and 5 b of an alternativeembodiment thereof;

FIG. 12 is a diagram similar to that shown in FIG. 3, with the samplingpoints being at substantially the octant switch points of the compasssystem; and

FIG. 13 is a diagram illustrating the magnetic zero referencerecalibration function.

DESCRIPTION OF THE PREFERRED EMBODIMENT

Referring now to the drawings and the illustrative embodiments depictedtherein, there is shown in FIG. 1 a block diagram of an electroniccompass system 10 having a calibration system according to the presentinvention. Electronic compass system 10 may be installed on a vehicle,such as a car, truck, mini-van, light truck, sport utility vehicle,motorcycle, boat, airplane or the like, to provide the operator orpassengers of the vehicle with information pertaining to a directionalheading of the vehicle. Electronic compass system 10 includes amagneto-responsive sensor 12, such as a magneto-resistive sensor of thetype disclosed in commonly assigned U.S. Pat. No. 5,255,442 issued toSchierbeek et al., the disclosure of which is hereby incorporated hereinby reference, a magneto-inductive sensor of the type disclosed incommonly assigned U.S. Pat. No. 5,924,212 issued to Domanski, or in U.S.Pat. Nos. 5,239,264 and 4,851,775, the disclosures of which are herebyincorporated herein by reference, a flux gate sensor, amagneto-capacitive sensor, or the like, all of which are known in theart. Magneto-responsive sensor 12 is preferably at least a two axissensor for sensing two components of a magnetic field. Compass system 10further includes a microcomputer 14, which includes software having analgorithm for digitally or algorithmically calibrating the compass, anda display 16, which is provided to display the directional informationto the operator of the vehicle. Display 16 may be part of a mirrorassembly of the type disclosed in commonly assigned U.S. Pat. Nos.6,005,538; 5,708,410; 5,610,756; 5,576,687; 5,530,240; and 5,285,060,the disclosures of which are hereby incorporated herein by reference.The mirror assembly may incorporate various accessories and functions,such as disclosed in commonly assigned U.S. Pat. Nos. 5,959,367 and5,929,786 and patent application Ser. No. 09/449,121 filed Nov. 24,1999, and Ser. No. 09/448,700 filed Nov. 24, 1999, the disclosures ofwhich are hereby incorporated herein by reference.

As shown in FIG. 2, an Earth magnetic field is generally represented asa substantially circular path 18 in a Cartesian coordinate system 20.The coordinate system 20 is shown associated with a vehicle 22,preferably such that one of the x and y axes 24 and 26, respectively,are oriented substantially in the direction that the vehicle 22 isheading. If vehicle 22 had no deviating magnetic field associatedtherewith, the magnetic field sensed by the magneto-responsive sensors12 would be the true Earth magnetic field and would be represented by asubstantially circular path 28 with a center point at an origin 30 ofcoordinate system 20. However, vehicles typically have a magneticsignature, or deviating magnetic field, associated with the vehicle andits surroundings, such that the Earth magnetic field 18 as sensed by thesensors 12 is offset from the origin 30 of the coordinate system 20,thereby resulting in an incorrect reading by the sensors 12. This isrepresented in FIG. 2 by a deviating field vector 32, which representsthe deviating magnetic field associated with the vehicle, an Earth fieldvector 34, which represents the Earth magnetic field centered about anorigin 35, and an error vector 36, which represents the magnetic fieldas sensed by the sensor. With no compensation system implemented, thevehicle illustrated in FIG. 2 would provide a directional signal to theoperator of the vehicle corresponding to a Northeasterly direction,represented by error vector 36, while the true heading of the vehicle isin a substantially Northerly direction as shown by the Earth fieldvector 34. Therefore, in order to provide an accurate directionaldisplay, the deviating magnetic field (represented by vector 32) must besubstantially nullified or offset such that the Earth magnetic field(represented by vector 34 and trace 18) provides the true directionalsignal to the vehicle's compass.

Electronic compass system 10 is preferably capable of magneticallybiasing or adjusting the output of magneto-responsive sensors 12 inresponse to a signal from the microprocessor 14. Such biasing may beaccomplished, for example, by generating an offset magnetic field, withthe sensors being responsive to the offset magnetic field and theexternal magnetic field. The external magnetic field is a combination ofthe Earth magnetic field and a deviating field of the vehicle and itssurroundings. An example of such a compass system is disclosed in theSchierbeek et al. '442 patent and commonly assigned U.S. Pat. Nos.5,644,851, 5,632,092 and 5,802,727 issued to Blank et al., each of whichis hereby incorporated herein by reference. Referring now to FIG. 1,sensors 12 of the compass system detect two components of a magneticfield that is the combination of the true Earth magnetic field and thedeviating field of the vehicle. The analog output of sensors 12 isdigitized and provided to microprocessor 14 via an Analog to Digital(A/D) converter 42. The microprocessor 14 receives the digital signalfrom A/D converter 42 and analyzes the signal to determine the trueEarth magnetic field which is supplied to the readout for display 16.This determination depends on the amount of deviation present and onwhich calibration stage that calibration system is in, as discussed indetail below. If a magnetic adjustment, or biasing, of sensors 12 isrequired, a Digital to Analog (D/A) converter 44 receives a signal frommicroprocessor 14 and accordingly changes the offset of one or both ofthe axes of sensor 12 in a similar manner as disclosed in the Schierbeeket al. '442 patent. If an internal algorithmic compensation of datareceived by microprocessor 14 is required, microprocessor 14 comparesdata points with data stored in an electronic memory storage unit 46, orEEPROM, and determines the appropriate adjustment, if any, of a signalthat is communicated to display 16.

Preferably, the calibration process of compass 10 of the presentinvention includes at least two calibration steps or procedures, whichare referred to as CAL-I and CAL-II and depicted in the flow charts ofFIGS. 5 and 6, respectively. However, additional calibration processesor stages may be implemented to further fine tune the system andreadjust the sensors 12, as the vehicle magnetic signature may changeover time. The first calibration step CAL-I of the present inventionprovides an initial offsetting or nullification of the vehicle magneticsignature or field.

The first calibration stage preferably provides electronic compasssystem 10 with a rapid and coarse adjustment of magneto-responsivesensors 12 in order to pull the sensors within a range of A/D converter42, so that microprocessor 14 is capable of digitally processing andfurther calibrating the compass system, such as by an algorithmcompensation, to accurately read the Earth magnetic field. Specifically,this initial step CAL-I collects a first data point, for example, a datapoint corresponding to one of the peaks of the Earth magnetic fieldnamely, where the Earth field indicates a true north, south, east orwest direction. An x and y component of this data point is sampledrelative to the origin 30 of coordinate system 20 and the microprocessor14 adjusts the sensor offset to bring the sensor output within anoperable range of Analog-to-Digital converter 42. This is accomplishedin a non-iterative process by using an assumed value of the Earthmagnetic field magnitude, such as 200 mG, to calculate an approximatezero point of the Earth magnetic field with respect to the axis on whichthe peak corresponds to, once a single peak value of the field isdetected by sensors 12. The opposite axis zero reference is then assumedto be at the corresponding value detected by Sensors 12. Sensors 12 arethen offset by values substantially equal to the x and y components ofthe deviation vector from the origin 30 of the vehicle coordinate system20 to the initial estimated center of the Earth magnetic field.Therefore, sensor 12 may be quickly biased to bring the origin of theEarth magnetic field within a predetermined range of the origin of thecoordinate system of the compass system, without manually calibrating orpresetting the vehicle in the assembly plant.

Referring now to the flow chart of FIGS. 5 a and 5 b, the processes ofthe CAL-I or first calibration stage 100 are shown. The process startsat 110 where the Digital to Analog converter 44 is zeroed and data arecollected at 115. If it is determined at 120 that a first axis point orpeak value is found, then the D/A signal for that axis and a first zeroreference value, designated MG0ref, for that axis is calculated at 130.If it is determined at 120 that a first axis point is not found, thenthe system 10 continues to collect data at 115 until it is determined at120 that a first axis point is found. After calculating the first zeroreference value at 130, the D/A signal for the axis opposite to the onethat was found and a second zero reference value relative to that axisare adjusted to a zero cross value at 140. The zero cross value isdetermined by assigning the detected value for that axis or ordinate tothe zero reference. One or both axes of the sensors are then offsetaccording to the D/A signals adjusted at 130 and 140, which provides acoarse non-iterative adjustment of sensors 12 to within a predeterminedtolerance level of accuracy. A compass heading may then be displayed andthe CAL light remains illuminated at 145.

As the vehicle is moved and turned in different directions, additionaldata points may be sampled at 150. It is then determined at 155 thenature of the next axis point that is found from the sampled datapoints. Microprocessor 14 determines at 155 that a point is along thesame axis and the same or opposite polarity of the first point, or thatit is along the other axis of the coordinate system. If it is determinedat 155 that the next axis point is along the same axis and the samepolarity, microprocessor 14 calculates a new zero reference relative tothe new data point at 160, using an assumed value of the Earth magneticfield such as 200 mG. The microprocessor then averages the first andsecond zero values and sets the D/A signal and first zero referenceaccordingly at 165, in order to offset the magnetic sensor's zero valuefor that axis.

If it is determined at 155 that the second data point is along the sameaxis but of the opposite polarity (an opposite peak), the microprocessorcalculates at 170 a zero value for that axis using the two data pointsand resets the corresponding zero reference and D/A signal for that axisaccordingly. The first and second zero cross values are averaged and theD/A signal and zero reference for the second axis are set at 175. A newvalue of the Earth magnetic field value is then calculated and saved forlater reference at 177. This new value will be used in latercalculations since it is likely to be a more accurate representation ofthe Earth magnetic field than the assumed value, which varies along thesurface of the Earth. If it is determined at 155 that the second axispoint detected is on an opposite axis, for example, the first axis pointis on the x axis and the second axis point is on the y axis, themicroprocessor calculates at 180 a new zero reference value (MGO_(ref))based on the two peak values obtained and the original estimate of theEarth magnetic field. If the new values are determined at 182, 185 to bewithin a certain predetermined tolerance level, the microprocessorcalculates an average for the x and y fields using the latest and storedvalues at 187 and stores the values of MGO_(ref) at 188. The average ofthe x and y zero reference points are then calculated at 190 and themagnetic sensor is offset according to the value of MGO_(ref). Thevalues are then stored at 191.

If it is determined at 182, 185 that the fields are not within thetolerance level, the values are stored at 192. The values are comparedto the previous data at 195 to determine if the difference is small andthus attributable to noise or normal variations in the magnetic fields,or large and thus attributable to an anomaly for which the compassshould not be immediately calibrated.

The CAL-I stage provides a physical adjustment of the magneto-responsivesensor 12, so that the outputs of the magneto-responsive sensors arewithin the operating range of A/D converter 42 wherein electroniccompass system 10 is sensing magnetic fields within a predeterminedtolerance band of the true center of the Earth magnetic field

After data along both axes have been collected and processed, which willoccur no later than after three different peaks have been detected, thecompass system is offset in a manner which should establish a certaintolerance level of nullifying the vehicle's deviating magnetic field.The reading given by the compass display to the operator of the vehicleshould be within an acceptable range of accuracy relative to the trueEarth magnetic field. The system switches to CAL-II mode at 196 andexits CAL-I at 197.

Referring now to FIG. 6, a flow chart of a calibration process 200performed by the microprocessor algorithm of the present invention isshown. The process 200, also referred to as CAL-II, starts at 210 by thesystem 10 initially performing an A/D out-of-range routine 215 in orderto determine whether readings from the magneto-responsive sensor 12 areat the limit of the range A/D converter 42 and, if so, whether theanomaly causing the condition is permanent or temporary (FIG. 8) and toenter the CALI routine if the change is permanent. After the A/Dout-of-range routine 215 is run, magneto-responsive sensor 12 senses andthe microprocessor 14 collects and processes additional values of thesensed magnetic field at 220. After data points are collected at 220, anaxis point detect routine 230 (FIG. 9) is conducted by micro-processor14. Axis point detect routine 230 is run to determine if a significantchange has occurred in the vehicle magnetic signature that may requireentering CAL-I to make significant changes to the outputs of D/Aconverter 44. After axis point detect routine 230 is performed, it isthen determined at 240 whether an intersect point is detected. If it isdetermined at 240 that an intersect point is detected, it is thendetermined at 245 whether a set, or pair, of intersect points has beendetected. If not, then additional data points are collected at 220 untilit is determined at 240 and 245 that intersect point sets have beendetected.

If it is determined at 245 that a intercept point set has been detected,algorithm 200 calculates at 250 an average of the opposite values of theintersect points and stores this average as a temporary zero reference(Tmp MGO_(ref)) for the axis between the pair of intercept points (TmpMGO_(ref)). An x/y validation value is determined at 255 using a knowncalibration technique. The value Tmp MGO_(ref) may then be compared to atest or validation value at 260. It is determined at 265 whether thesereference values are outside of an acceptable tolerance value. If so,the vehicle compass system continues to collect additional values atother intercept points around the path representing the Earth magneticfield (210-255). If it is determined at 265 that the values are withinthe tolerance level, the zero reference value for that axis is adjustedat 270. One technique for updating the magnetic zero reference would beto average the values obtained at 250 with the validation valuesobtained at 255. Alternatively, if it is determined at 265 that thevalues are within the tolerance level, the value of Tmp MGO_(ref) may beadopted as MGO_(ref).

A zero reference, MGO_(ref), recalibration routine 272 is then performed(FIGS. 10 and 13) after the value for MGO_(ref) is updated (210-270).The purpose of the MGO_(ref) recalibration routine is to makeincremental adjustments to outputs of D/A converter 44 to compensate forsignificant changes made to the value of MGO_(ref) to keep the correctedreadings of sensors 12 well within the operating range of A/D converter42. Preferably, the goal is to keep the corrected readings of sensors 12generally centered in the operating range of A/D converter 42. After thezero reference recalibration routine 272 is performed, the intersectdata is then purged at 275. The process then switches to a thirdcalibration (CAL-III) mode at 285, if it is determined at 280 that avalue of MGO_(ref) has been obtained and, therefore, the CAL-II mode iscomplete.

Most preferably, the third calibration stage 300 or CAL-III (FIG. 7)uses the same techniques as CAL-II, but requires multiple confirmationsof detected changes, by collecting additional pairs of intercept datapoints, before concluding that a change in the calibration of thevehicle compass is actually necessary. Thereby, CAL-III is a dampedversion of the second calibration stage CAL-II since the vehicle compasscalibration will only be adjusted if a predetermined number of datapoints are collected which convey an error in the present calibration.The CAL-III routine 300 includes steps 310-365 which correspond withsteps 210-265 in the CAL-II routine 200. After it is determined at 365that the reference values are within the tolerance values, it is thendetermined at 366 whether a number of N sets of values have beencollected which all agree with each other within a particular tolerance.If so, then a new value of MGO_(ref) is adopted which corresponds to theN sets of values. In the illustrated embodiment, the N sets may becollected without respect to ignition cycles. Alternatively, it may berequired that the N sets be collected over a number of ignition cyclesin order to ensure their validity prior to modifying the value ofMGO_(ref) at 370. After a new value of MGO_(ref) is determined inCAL-III, the MGO_(ref) recalibration routine is conducted at 372 andintersect data points are purged at 375. The CAL-III routine is thenperformed again beginning at 315.

By requiring additional data points before changing the calibration ofthe system, CAL-III prevents the system from recalibrating in responseto noise in the data or, for example, each time the vehicle windshieldwipers are activated or the vehicle passes through a bridge or tunnel orencounters any other structure which may temporarily alter either thevehicle's magnetic signature or the Earth magnetic field. Unless theseanomalies are substantially continuous over a period of time, CAL-IIIdoes not adjust the system, thereby avoiding a temporary inaccuratereading of the actual directional heading of the vehicle. For example,CAL-III may not change the zero reference points for an axis until threeor more consecutively sampled sets of intercept points, or sample setstaken over multiple ignition sequences of the vehicle, confirm that acalibration change is necessary. Only if the anomalies continue for aprolonged period of time or over a number of samples does calibrationsystem 10 assume that they are not merely temporary anomalies and adjustthe compass calibration accordingly. The techniques of the algorithmassociated with CAL-III are applied automatically and continuously asthe vehicle is being driven, thereby continuously adjusting the compasssystem only as is deemed necessary such that it maintains a properdirectional reading to the operator of the vehicle.

During the second calibration stage, or state, CAL-II, and the thirdcalibration stage, or state, CAL-III, compass system 10 preferablycollects data points at a number of particular points referred to asintercept points around a substantially circular or elliptical trace 18representing the Earth magnetic field for various orientations of thevehicle. In particular, eight intercept points, representing four pairsof points are located on trace 18 by choosing a first x value anddetermining a positive y coordinate and negative y coordinate for that xvalue. A midpoint, or null, is determined for that pair. This isrepeated for a second x value on the opposite side of the y axis fromthe first x value. Two more intercept pairs are selected by choosing avalue of y and determining an x coordinate and −x coordinate for that yvalue. A midpoint, or null, is then determined for that pair. This isrepeated for a second value of y on the opposite side of the x axis fromthe first y value. From the four null values determined in this fashion,a true value of the deviating field vector 32 can be determined.

As shown in FIGS. 3 and 4, the x and y coordinates may be at points 50,where a vertical line, which passes through a point on the x axisrepresenting a reduced value, such as half of the magnitude of themeasured Earth magnetic field (E), intercepts the trace 18. These mayalso be x and y coordinates, such as at points 52, where a substantiallyhorizontal line passing through the y axis at a point representing areduced value, such as approximately half of the magnitude the Earthmagnetic field value (E) likewise intercepts the trace 18. The vehiclecompass system samples data at these points as the vehicle is driven andtemporarily stores them in the memory unit 46. The vehicle need not bedriven in a circle to collect these data points, as each point iscollected when and if the vehicle is actually headed in that direction.Once a first intercept point is collected, the data at that point isstored until a second intercept point is encountered, such as a pointopposite the respective axis of the first intercept point, whereby thepair of points share a common x or y component with respect to thecoordinate system 20 associated with the vehicle. For example, if thefirst point is detected at point A (FIG. 3) having a coordinate (x₁,y₁), that point is stored until data is also collected at point B havinga coordinate (x₁,−y₁), thereby completing a set or pair of interceptpoints. The microprocessor then uses the pairs of intercept values andcalculates a predicted zero value by averaging one of the coordinatesfor that pair.

Preferably, another of the known techniques for compass compensation maybe used for validating the value of the deviating field vectordetermined using the intercept point technique. If the zero value, ornull, obtained using the intercept point technique, when compared withthe results obtained by the other technique, is valid then no more datais collected. If not, then additional data points are collected.Preferably, the data collected from the intercept point technique isused for final calibration of the compass. Alternatively, the datacollected from the intercept point technique may be averaged with thedata collected to validate the data collected from the intercept pointtechnique.

If the other data collected is not within a predetermined tolerance ofwhere the intercept points predicted they should be, then additionalintercept data may be obtained to determine if an anomaly has occurredeither in the system or in the surrounding environment. The additionalintercept data is then used to determine a new approximate center of ordeviating vector to the Earth magnetic field.

The x and y components of the deviating vector are then mathematically“subtracted out” of the signal such that a more accurate representationof the vehicle heading relative to the Earth magnetic field is conveyedto display 16. Fine tuning this system with potentially only a few datapoints collected, CAL-II provides for a quick refinement of the vehiclecompass to be within a specified tolerance range which is substantiallytighter than the tolerance level applied to CAL-I. Preferably, CAL-IIcould be completed within a few test drives of the vehicle at a dealer'slot, such that the system is quickly accurate to within the specifiedtolerance level as required by the vehicle manufacturers.

Although the CAL-II and CAL-III calibration states are described ascollecting intercept points at the mid-values of the Earth magneticfield, clearly other intercept points could be used without affectingthe scope of the present invention. For example, as shown in FIG. 7,data may be sampled at each of the octant switch points 58, where thevehicle compass system changes its display from one direction to thenext directional heading, such as from North to Northeast. Other datapoints may alternatively be used which are determined by using variousangles to get the x and y coordinates and then averaging the oppositevalues, without affecting the scope of the present invention.

By collecting data at multiple specific points along the pathrepresenting the Earth magnetic field, averaging the values of a pair orset of points and using this data to calculate a center point of thepath, the vehicle compass system is capable of collecting enough datawithout having to be turned through a 360 degree circle or be directedin substantially opposite directions, as is required in many of theprior art calibration systems. This also allows calibration process 200to accurately calibrate compass system 10 while only requiring a limitednumber of data points to be stored at any time. Further, themathematical algorithm implemented according to the present invention isrelatively straightforward in that it merely averages sets of datapoints in order to calculate a center value of the circle, which avoidsextensive mathematical calculations associated with arcs of a circle orthe like. An additional benefit of the present invention is that notonly is it easily applied to the generally circular path of the Earthmagnetic field, but it applies equally as well to a substantiallyoval-shaped Earth magnetic field 18′, as shown in FIG. 4. This allowsthe system to calibrate the vehicle compass and maintain its accuracy insituations or conditions where the Earth magnetic field is notsubstantially circular in shape when plotted on the Cartesian coordinatesystem 20 of the present vehicle compass.

The CAL-II and CAL-III modes therefore account for relatively minorchanges of the vehicle magnetic signature. However, significant changesmay occur that are beyond the capabilities of A/D converter 42 andmicroprocessor 14 of compass system 10. For example, the magneticsignature of a vehicle may change significantly if changes are made thatmay shift the deviating field of the vehicle. The shift may be due to aphysical change to the vehicle, such as body work done on the vehicle,or a change to its surroundings. Also, the compass system may drift overtime in a way that mathematical correction to the sensor headings maynot be sufficient to keep the system calibrated. Accordingly, compasssystem 10 of the present invention preferably includes one or moreextended calibration techniques. The extended range calibrationtechniques provide both fine and coarse adjustment to the sensing rangeof magneto-responsive sensor assembly 12 to keep the outputs of thesensor assembly within the operating range of A/D converter 42throughout the operating life of the system 10. This may be accomplishedin the illustrated embodiment by making fine or coarse adjustments toD/A converter 44 to adjust the operating range of sensor assembly 12. Inthe illustrated embodiment, extended range calibration techniquesinclude one or more of A/D out-of-range routine 215, axis point detectrange 230 and magnetic zero reference recalibration routine 272.

The A/D out-of-range routine 215, 315 begins at 400 and determines at402 whether the outputs of sensor assembly 12 fall outside of the rangeof A/D converter 42 (FIG. 8). This may be accomplished be determiningthat A/D converter 42 is at one end of its range when attempting toconvert an output of sensor assembly 12. If so, then a magnetic anomalyhas occurred. The magnetic anomaly may be temporary, such as the vehiclebeing within a tollbooth, or a magnetic item, such as a magneticallymounted flag, being temporarily placed on the vehicle close to sensor12. Alternatively, the anomaly may be permanent, such as a sunroof beingcut in the vehicle roof or a permanent magnet mount being placed on thevehicle close to sensor 12. In order to distinguish between the two, theA/D out-of-range routine 215, 315 increments an out-of-range counter at404 and determines at 406 whether the out-of-range counter has beenincremented to a particular value. This allows the routine todistinguish between very short magnetic anomaly, such as passing under abridge through a tollbooth or the like, and long-term magnetic anomaly,such as adding a sunroof. If the counter exceeds the predetermined valueat 406, it is then determined at 408 whether this is the first time thecounter has been incremented since the ignition has been turned on. Ifso, then an ignition cycle counter is incremented at 411. The purpose ofthe ignition counter is in order to monitor anomaly which may extendbeyond single ignition cycles. For example, a magnetically mounted flagfor a funeral may span one or two ignition cycles, but likely not morethan that. However, a magnetically mounted antenna would span multipleignition cycles. It is then determined at 412 whether the ignition cyclecounter is greater than or equal to a predetermined value x. If so, thenmicroprocessor 14 causes the program to enter the CAL-I routine. In theCAL-I routine, the output of D/A converter 44 is re-established in orderto place the outputs of sensors 12 within the range of A/D converter 42.It will also then be necessary to subsequently enter the CAL-II routinein order to re-establish a value for MGO_(ref). If it is determined at402 that the output of sensor 12 is not outside of the A/D converterrange, the routine is exited at 418 and the data collection portions220, 320 of the respective CAL-II or CAL-III routines performed.

The axis point detect routine 230, 330 is for the purpose of determiningthat large changes have occurred in the output of sensors 12 (FIG. 9).This is accomplished by examining the values of the data pointscollected at 220, 320 and determining whether the peak readings of thedata points, for example, in the x axis or the y axis, show up on theincorrect side of the value of MGO_(ref) than would be expected undernormal operation. For example, if the peaks in the x axis data areexpected to occur on opposite sides of the value MGO_(ref) and, instead,both values of the x peak fall on one side or the other of the value ofMGO_(ref), then it is concluded that an abrupt change in the magneticsignature of the vehicle has occurred. When such condition is detectedat 422, a counter is incremented at 426. It is then determined at 428whether the value of the counter is greater than or equal to aparticular predetermined value. This is in order to avoid recalibrationof the system 10 for temporary anomaly, such as by passing through atollbooth or the like. If it is determined at 428 that the value of theincremental counter is greater than the predetermined number,microprocessor 14 enters the CAL-I routine at 430. This results in theoutputs of D/A converter 44 being adjusted in order to bring the outputsof sensor 12 within the range of A/D converter 42. Alternatively, it maybe possible to utilize an ignition cycle counter, such as that utilizedin the A/D out-of-range routine 215, 315, in order to avoid respondingto anomalies that span no more than a few ignition cycles of thevehicle. When the axis point detect routine is exited at 424, therespective CAL-II or CAL-III routine proceeds to 240, 340 to determinewhether intersect points have been detected.

The MGO_(ref) recalibration routine 272, 372 is initiated at 432 andproceeds if the routine is in the CAL-II or CAL-III cycle, at 434. It isthen determined at 436 whether the value of MGO_(ref), as updated at270, 370, has changed more than a particular step size A. In theillustrated embodiment, the step size A is set to 100 milligauss whichis approximately 20 to 40 percent of the range 450 of A/D converter 42(FIG. 13). When it is determined at 436 that the change to the value ofMGO_(ref) is greater than a step size designated A, the microprocessor14 adjusts the output of D/A converter 44 by the value A in order toreposition the output of sensor 12 within the range 450 of A/D converter42. FIG. 13 illustrates a step change in MGO_(ref) along the y axis. TheMGO_(ref) recalibration routine would also apply to changes along the xdirection. Preferably, microprocessor 14 adjusts the output of D/Aconverter 44 in a manner which tends to substantially center the outputof sensor 12 within the range 450 of A/D converter 42.

When the output of D/A converter 44 is adjusted by the value of A, thevalue of MGO_(ref) is no longer valid, the control program then entersthe CAL-II routine at 440 in order to establish a new value ofMGO_(ref). The MGO_(ref) routine is exited at 442 and control passes to275,375 in the respective CAL-II or CAL-III routines.

An alternative form 500 of a CAL-I routine, which is based upon thelocation of opposite magnetic peaks on one axis and one peak on theother axis, is illustrated in FIG. 11. CAL-I routine 500 achieves a moreaccurate result than CAL-I routine 100, but takes somewhat longer tocomplete. Referring to FIG. 11, CAL-I routine 500 begins at 502 bycollecting data points and determines at 504 whether the data points areoutside the range of the A/D converter 42 in the same manner aspreviously described. If the data points are outside of the A/D range,microcomputer 14 adjusts D/A converter 44 to bring the outputs of thesensor assembly 12 within the range of the A/D converter in the samemanner as in CAL-I routine 100. When the data points are within therange of the A/D converter, it is determined at 508 if this is the firsttime through the routine. If so, microcomputer 14 adjusts D/A converter44 to produce a zero output from sensor assembly 12. If it is determinedat 508 that this is not the first pass through the routine, it isdetermined at 512 and 514 if both points are found for one axis. If so,a value for MGO is determined at 516 in the same manner as for the CAL-Iroutine 100. It is then determined at 518 if an axis point is found onthe opposite axis. If so, a value of MGO is determined at 522 for theaxis having only one axis point. If it is determined at 514 that asecond axis point is not found on that axis, then it is determined at520 whether both axis points have been found on the other axis. If so,the value of MGO is established at 522 for the axis with only one axispoint. Microcomputer 14 determines the value of MGO for both axes fromonly three axis points by determining the strength of the Earth magneticfield from the axis with both minimum and maximum axis values. Thisinformation is used in the value of the Earth magnetic field todetermine the MGO value for that axis and to determine the MGO value forthe axis having only one axis point. This improves accuracy over theprior technique which uses an estimated value for the Earth magneticfield.

Compass system 10 of the present invention may also be implemented on amotorcycle. Typically, compass systems are difficult to calibrate on amotorcycle due to the tilting of the vehicle from one side to another asit turns. Such tilting causes errors in the directional readings of theprior art compass systems, as they require a substantially horizontal orlevel orientation in order to accurately detect and process the Earthmagnetic field. The present invention, on the other hand, substantiallyprecludes such errors due to its multiple stages and continuous samplingof data as the vehicle or motorcycle is driven. Preferably, CAL-I andCAL-II could be performed quickly while the motorcycle is level or whiletraveling in a substantially figure eight path, so as to offset eachtilt with a substantially equal and opposite tilt. In other words, apair of sample points may require opposite tilts as well as beingopposite a respective axis. CAL-III would then preferably function asdescribed above, requiring additional data points in order to cause achange in the calibration of the compass system, so as to gather datathat would include varying degrees and directions of tilt. Additionally,compass system 10 may be interconnected with a level measuring device,such that data points are sampled for any of the calibration stages onlywhen the vehicle or motorcycle is within a predetermined range of alevel or horizontal orientation based upon an output of the levelmeasuring sensor or device.

Compass system 10 of the present invention may also be interconnectedwith a vehicle security system or device which detects movement of thevehicle when the compass system is not typically active, such as whenthe ignition has not been activated. The security system preferablysenses or interrogates the compass system periodically while theignition is off. If the compass heading changes while the ignition isnot activated, then the security system determines that the vehicle isbeing tampered with such as being towed or otherwise hauled away. Thesecurity system may then activate an alarm or signal or may transmit acommunication to a predetermined receiving device in response to thisdetermination. This communication may be interconnected with a policetracking system and/or with a Global Positioning System in order toconvey the new vehicle location to the recipient of the message.

This security system may alternatively be interconnected with othercompass systems or with a level sensor, such as a leveling device for avehicle suspension, such as of the type disclosed in commonly assignedprovisional patent application Ser. Nos. 60/121,462, filed Feb. 24,1999, and Ser. No. 09/511,587, filed on Feb. 23, 2000, by Eric Hoekstra,the disclosures of which are hereby incorporated herein by reference.These devices are used to detect when the vehicle is not in a levelorientation, such as when the vehicle is towing a load. One such deviceincludes a substantially vertical or horizontal lever interconnectedwith a potentiometer or other measuring device. The measuring device mayinclude a magneto resistive sensor which senses an angular rotation of amagnetic element rotatably interconnected to a portion of the vehiclesuspension. The security system may sense or monitor the leveling devicewhen the ignition is in an off position. If the signal from thepotentiometer or other measuring device changes while the vehicle isoff, the security sensor then determines that the vehicle is beingtampered with or otherwise being moved or towed away. As discussedabove, the security system then may activate an alarm or communicate asignal or message in response to this determination. A display may alsoconvey a degree of tilt of the vehicle to a driver or occupant of thevehicle or an adjustable suspension may be adjusted in response to apredetermined amount of tilt to counter the tilt and level the vehicle.For example, air may be supplied to or extracted from an air suspensionunit to raise or lower a portion of the vehicle in order to level thevehicle.

Although described as monitoring a compass system or a leveling system,the security system discussed above may alternatively monitor orinterrogate other devices or systems associated with the vehicle thatare normally used or activated only when the vehicle is running. Thesecurity system monitors these devices when the vehicle is off todetermine if the vehicle is being tampered with or moved. For example,the security system may monitor a wheel speed sensor, a transmissionpark sensor, a steering wheel or front wheel turning sensor or any othersensor or device that is not typically moved, activated or changed aftera vehicle is parked and the ignition is turned off. Detection of motionor change in these types of devices when the ignition is off isgenerally a sign that the vehicle is being tampered with by someoneother than the owner of the vehicle. Therefore, the security systemwould activate an alarm or signal in response to such a detection.

The compass system disclosed herein can also be useful with an outdoortemperature monitor. Such temperature monitors typically read aparameter of a temperature probe, mounted to sense exterior temperature,after a particular interval. The interval is selected to avoidpreemption of other functions performed by the processor. Such intervalis usually adequate when the vehicle is moving. However, when a vehiclesits in a garage or in the sun, the temperature sensed by the exteriortemperature sensor may be in error when a vehicle begins movement. Thecompass system can be used to signal the processor that the vehicle hasbegun moving. The processor can then take one or more immediatesamplings of the temperature sensor to update the reading during suchtransient situations. Other situations where the ability of a headingsensor such as a compass system to determine vehicle movement canprovide useful information, both when the vehicle is running and notrunning, will be apparent to the skilled artisan.

Compass system 10 of the present invention provides for a cost effectivemeans for continuously and automatically calibrating vehicle electroniccompass systems. The present invention coarsely biases the magneticsensors to be within a predetermined range of accuracy and thenalgorithmically fine tunes the system with straight forward processingthat does not require extensive memory. Furthermore, all of thecalibration procedures of the present invention may be applied to acompass system of a vehicle without requiring the vehicle to be drivenin a complete 360 degree or otherwise oriented in specific predetermineddirections during the calibration process. The calibration system isalso capable of accurately calibrating the vehicle compass system inareas where the Earth magnetic field may not provide a substantiallycircular path in the coordinate system of the vehicle compass. Thepresent invention also provides for extended range calibration in orderto keep an electronic compass system in calibration over the life of thevehicle in which it is installed.

Therefore, an effective and low cost vehicle calibration system isprovided which continuously and automatically calibrates and maintainscalibration of the vehicle compass system without any attention requiredby the operator of the vehicle or other technicians. Furthermore, thecalibration system of the present invention avoids the necessity torecalibrate the system every time an anomaly is encountered by requiringmultiple data points which confirm that a change is actually necessary.

Changes and modifications in the specifically described embodiments canbe carried out without departing from the principles of the invention,which is intended to be limited only by the scope of the appendedclaims, as interpreted according to the principles of patent law.

1-48. (canceled)
 49. A calibration method for calibrating a compass foruse on a vehicle, said method comprising: sampling at least one datapoint of a magnetic field with a magnetic sensor; determiningcoordinates for said at least one data point relative to an origin of acoordinate system associated with the vehicle; estimating an origin ofan Earth magnetic field from an estimated value of the Earth magneticfield magnitude and at least one data point; and adjusting the sensor tooffset the estimated origin to the coordinate system associated with thevehicles.
 50. The calibration method of claim 49 further comprising:sampling pair of data points that are substantially oppositelypositioned relative to one axis of said coordinate system; averaging thesubstantially opposite values of said pair of data points to determinedeviation from a zero value of the coordinate system; and adjusting anoutput of the system as a function of said deviation.
 51. Thecalibration method of claim 50 further comprising validating saiddeviation by comparing said deviation with another value determined by adifferent technique.
 52. The calibration method of claim 51 includingsampling additional data points if said deviation is not valid.
 53. Acalibration method for calibrating a compass system for use on avehicle, said method comprising: sampling at least one pair of datapoints that are substantially oppositely positioned relative to an axisof a coordinate system; averaging the substantially opposite values ofsaid pair of data points to determine deviation from a zero value of thecoordinate system; and adjusting an output of the compass system as afunction of said deviation.
 54. The calibration method of claim 53further comprising validating said deviation by comparing said deviationwith another value determined by a different technique.
 55. Thecalibration method of claim 54 including sampling additional data pointsif said deviation is not valid.
 56. A calibration method for calibratinga compass for use on a vehicle, comprising: collecting data points witha sensor assembly, determining from the collected data points an offsetvalue of the Earth magnetic field, and adjusting a directional headingoutput of said sensor assembly to account for said offset; andidentifying a change in magnetic signature from at least one of saidsensor assembly and said offset value and adjusting said sensor assemblyin response to a change in magnetic signature.
 57. The calibrationmethod of claim 56 wherein a change in magnetic signature is identifiedfrom said sensor reaching a limit of operation of said electroniccircuit.
 58. The calibration method of claim 56 wherein a change inmagnetic signature is identified from an abnormal relation betweencollected data points and said offset.
 59. The calibration method ofclaim 56 wherein a change in magnetic signature is identified from anabnormal relation between collected data points and said offset.
 60. Thecalibration method of claim 59 wherein said abnormal relation comprisessaid offset falling outside of opposite peak values of data points.